<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<!-- 
		Replace path to template, title, header and body
		with actual data.
	 -->
<ui:composition template="../template/layout.xhtml">
	<ui:define name="titulo">#{authIdiomaController.tituloPagina}</ui:define>

	<ui:define name="frConteudo">
		<h:form id="form">
			<!-- 
							<h:outputLabel value="" />
							<h:inputHidden value="#{authIdiomaController.infoBean.id}" />
							-->
			<h:panelGrid columns="1" border="0" height="100%">

				<!-- bloco de edição -->
				<p:panel header="#{authIdiomaController.tituloPagina}"
					rendered="#{authIdiomaController.estadoCrud}">
					<h:panelGrid border="0" columns="2">
						<f:facet name="header">
							<p:messages id="msgErro" />
						</f:facet>

						<h:outputLabel value="#{msg.authIdioma}" for="idioma" />
						<h:inputText id="idioma" label="#{msg.authIdioma}"
							value="#{authIdiomaController.infoBean.idioma}" required="true"
							requiredMessage="#{msg.authIdiomaRequiredMessage}" />

						<h:outputLabel value="#{msg.authIdiomaCodigo}" for="codigo" />
						<h:inputText id="codigo" label="#{msg.authIdiomaCodigo}"
							value="#{authIdiomaController.infoBean.codigoIso}" required="true"
							requiredMessage="#{msg.authIdiomaCodigoRequiredMessage}" />

						<h:outputLabel value="#{msg.authIdiomaActivo}" for="activo" />
						<h:selectBooleanCheckbox id="activo" label="#{msg.authIdiomaActivo}"
							value="#{authIdiomaController.infoBean.activo}" />
							
						<f:facet name="footer">
							<h:panelGroup>
								<center><h:commandButton id="salvarButton"
									value="#{msg.salvarButton}"
									action="#{authIdiomaController.adicionar}"
									rendered="#{authIdiomaController.estadoAdicionar}" /> <h:commandButton
									id="alterarButton" value="#{msg.alterarButton}"
									action="#{authIdiomaController.editar}"
									rendered="#{authIdiomaController.estadoActualizar}" /> <h:commandButton
									id="eliminarButton" value="#{msg.eliminarButton}"
									action="#{authIdiomaController.eliminar}"
									rendered="#{authIdiomaController.estadoEliminar}"
									onclick="if(!confirm('Confirma a exclusão do registo?')) return false;" />
								<h:commandButton id="limparButton" value="#{msg.limparButton}"
									type="reset" rendered="#{authIdiomaController.estadoAdicionar}" />
								<h:commandButton id="cancelarButton"
									value="#{msg.cancelarButton}"
									action="#{authIdiomaController.voltar}" immediate="true" /></center>
							</h:panelGroup>
						</f:facet>
					</h:panelGrid>
				</p:panel>
				<!-- fim do bloco de edição -->
			</h:panelGrid>
			<br />
			<h:panelGroup>
				<h:commandLink action="#{authIdiomaController.voltar}" immediate="true"
					value="#{msg.geralLinkListaRegistos}" />
				<h:outputText value="  " />
				<h:commandLink action="#{authIdiomaController.voltar}" immediate="true"
					value="#{msg.geralInicio}" />
			</h:panelGroup>
		</h:form>
	</ui:define>
</ui:composition>
</html>